//
//  NSObject+KLSupportRACKVO.h
//  yangtao
//
//  Created by Tommy on 14/10/28.
//  Copyright (c) 2014年 com.taobao. All rights reserved.
//

#import <Foundation/Foundation.h>


#define KLRAC(TARGET, ...) \
metamacro_if_eq(1, metamacro_argcount(__VA_ARGS__)) \
(KLRAC_(TARGET, __VA_ARGS__, nil)) \
(KLRAC_(TARGET, __VA_ARGS__))

/// Do not use this directly. Use the RAC macro above.
#define KLRAC_(TARGET, KEYPATH, NILVALUE) \
[[KLRACSubscriptingAssignmentTrampoline alloc] initWithTarget:(TARGET) nilValue:(NILVALUE)][@keypath(TARGET, KEYPATH)]

@class RACSignal,RACDisposable;

@interface KLRACSubscriptingAssignmentTrampoline : NSObject

- (id)initWithTarget:(id)target nilValue:(id)nilValue;
- (void)setObject:(RACSignal *)signal forKeyedSubscript:(NSString *)keyPath;



@end

@interface NSObject (KLSupportRACKVO)

- (void)setKLDisposable:(RACDisposable*)dispose forKeyPath:(NSString *)keyPath;
- (RACDisposable*)klDisposable:(NSString*)keyPath;
- (void)removeKLDisposable:(NSString*)keyPath;
@end
